To configure a project built by Embarcadero's C++ Builder, the following settings should be applied to achieve the best results.

Win32 and Win64 Projects

For either Win32 or Win64 projects, after opening a project within the IDE, enable the Debug configuration. First you must ensure the debug configuration is set to link with the Dynamic RTL and the Delphi Runtime Library.

This is required as WonderLeak must be able to hook the dynamically loaded borlndmm.dll library in order to trace allocations from the Borland heap. If you do not enable the above two settings, the borland memory manager will be statically linked into the projects EXE file and WonderLeak will not be able to hook the Borland heap.

Next you should set the Debug configuration to link with runtime packages.

This is required so allocations occurring from System::SysAllocMem will be serviced by the dynamically linked runtime library (RTL) (eg. rtl270.bpl). If this setting is not enabled, these allocations will be serviced by a statically linked allocator and WonderLeak will not be able to trace these allocations.

As you are building a debug configuration, debug symbols will be created by default. Similarly, all optimizations are disabled by default. This is the recommended configuration.

Win32 Only

For a Win32 project you should ensure that the C++ Compiler setting Standard Stack Frames is set to true in order to allow WonderLeak accurately capture stack traces.

Win32 projects will use the Turbo Debug (TD32 or TDS) symbol format. This format may emit source file paths as relative paths, relative to the project file (.cbproj) of the application. To allow WonderLeak locate source files with relative paths, you must add a suitable Source file local search paths entry via the applications Symbol Settings.

Copyright © 2021, Relyze Software Limited